Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additionally handle logstart and logfinish hooks #3189

Merged

Conversation

s0undt3ch
Copy link
Contributor

Thanks for submitting a PR, your contribution is really appreciated!

Here's a quick checklist that should be present in PRs:

  • Add a new news fragment into the changelog folder
    • name it $issue_id.$type for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of removal, feature, bugfix, vendor, doc or trivial
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
  • Target: for bugfix, vendor, doc or trivial fixes, target master; for removals or features target features;
  • Make sure to include reasonable tests for your change if necessary

Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please:

  • Add yourself to AUTHORS, in alphabetical order;

@s0undt3ch s0undt3ch force-pushed the feature/logstart-logfinish branch from e98ae1f to 4eccf4d Compare February 5, 2018 17:48
@s0undt3ch s0undt3ch mentioned this pull request Feb 5, 2018
4 tasks
@s0undt3ch s0undt3ch force-pushed the feature/logstart-logfinish branch from 4eccf4d to 23c15f9 Compare February 5, 2018 19:13
@coveralls
Copy link

coveralls commented Feb 5, 2018

Coverage Status

Coverage increased (+0.006%) to 92.634% when pulling ea06c13 on s0undt3ch:feature/logstart-logfinish into f2fb841 on pytest-dev:features.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @s0undt3ch, thanks!

@@ -371,18 +371,20 @@ def _runtest_for(self, item, when):
formatter=self.formatter, level=self.log_level) as log_handler:
if self.log_cli_handler:
self.log_cli_handler.set_when(when)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add the following code here and remove your if item checks:

if item is None:
    yield
    return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@twmr
Copy link
Contributor

twmr commented Feb 5, 2018

Thx for working on this!

@s0undt3ch s0undt3ch force-pushed the feature/logstart-logfinish branch from a2369c3 to c9123c6 Compare February 6, 2018 10:11
@s0undt3ch
Copy link
Contributor Author

@nicoddemus sorry, I force pushed the changes asked by @Thisch and lost your change log changes(forgot to pull first).

@nicoddemus
Copy link
Member

I force pushed the changes asked by @Thisch and lost your change log changes(forgot to pull first).

No worries, just pushed my change again. 👍

@s0undt3ch
Copy link
Contributor Author

Thanks!

@s0undt3ch s0undt3ch force-pushed the feature/logstart-logfinish branch from 8abc7a4 to a8ac48c Compare February 6, 2018 10:39
if not hasattr(item, 'catch_log_handlers'):
item.catch_log_handlers = {}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This newline and the next one are not really needed. Can you remove them please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx

@s0undt3ch s0undt3ch force-pushed the feature/logstart-logfinish branch from a8ac48c to ea06c13 Compare February 6, 2018 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants